package com.maxlen.order.feign;

import com.maxlen.common.utils.R;
import com.maxlen.order.entity.to.CouponLockTO;
import com.maxlen.order.entity.to.SkuInfoAndCartItemTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient("store-coupon")
public interface CouponFeignService {

    /**
     * 远程调用：获取商品积分
     * @param spuIdList spuIdList
     * @return
     */
    @PostMapping("/coupon/spubounds/getSpuBoundsBySpuId")
    R getSpuBoundsBySpuId(@RequestBody List<Long> spuIdList);

    /**
     * 远程调用：获取用户下单的商品的优惠金额
     * @param skuInfoAndCartItemTO
     * @return
     */
    @PostMapping("/coupon/couponhistory/getOrderCouponPrice")
    R getOrderCouponPrice(@RequestBody SkuInfoAndCartItemTO skuInfoAndCartItemTO);

    /**
     * 锁定优惠券
     * @param couponLockTO 参数
     * @return
     */
    @PostMapping("/coupon/couponhistory/lockCouponByMemberId")
    R lockCoupon(@RequestBody CouponLockTO couponLockTO);

}
